package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementDcnConnectorMapper;
import com.ruoyi.net.domain.ElementDcnConnector;
import com.ruoyi.net.service.IElementDcnConnectorService;

/**
 * 网元-DCN配置-DCN连接配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementDcnConnectorServiceImpl implements IElementDcnConnectorService 
{
    @Autowired
    private ElementDcnConnectorMapper elementDcnConnectorMapper;

    /**
     * 查询网元-DCN配置-DCN连接配置
     * 
     * @param id 网元-DCN配置-DCN连接配置主键
     * @return 网元-DCN配置-DCN连接配置
     */
    @Override
    public ElementDcnConnector selectElementDcnConnectorById(String id)
    {
        return elementDcnConnectorMapper.selectElementDcnConnectorById(id);
    }

    /**
     * 查询网元-DCN配置-DCN连接配置列表
     * 
     * @param elementDcnConnector 网元-DCN配置-DCN连接配置
     * @return 网元-DCN配置-DCN连接配置
     */
    @Override
    public List<ElementDcnConnector> selectElementDcnConnectorList(ElementDcnConnector elementDcnConnector)
    {
        return elementDcnConnectorMapper.selectElementDcnConnectorList(elementDcnConnector);
    }

    /**
     * 新增网元-DCN配置-DCN连接配置
     * 
     * @param elementDcnConnector 网元-DCN配置-DCN连接配置
     * @return 结果
     */
    @Override
    public int insertElementDcnConnector(ElementDcnConnector elementDcnConnector)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementDcnConnector.getId())) {
            elementDcnConnector.setId(uuid);
        }
        elementDcnConnector.setCreateBy(SecurityUtils.getUsername());
        elementDcnConnector.setCreateTime(DateUtils.getNowDate());
        elementDcnConnector.setUpdateBy(SecurityUtils.getUsername());
        elementDcnConnector.setUpdateTime(DateUtils.getNowDate());
        return elementDcnConnectorMapper.insertElementDcnConnector(elementDcnConnector);
    }

    /**
     * 修改网元-DCN配置-DCN连接配置
     * 
     * @param elementDcnConnector 网元-DCN配置-DCN连接配置
     * @return 结果
     */
    @Override
    public int updateElementDcnConnector(ElementDcnConnector elementDcnConnector)
    {
        elementDcnConnector.setUpdateBy(SecurityUtils.getUsername());
        elementDcnConnector.setUpdateTime(DateUtils.getNowDate());
        return elementDcnConnectorMapper.updateElementDcnConnector(elementDcnConnector);
    }

    /**
     * 批量删除网元-DCN配置-DCN连接配置
     * 
     * @param ids 需要删除的网元-DCN配置-DCN连接配置主键
     * @return 结果
     */
    @Override
    public int deleteElementDcnConnectorByIds(String[] ids)
    {
        return elementDcnConnectorMapper.deleteElementDcnConnectorByIds(ids);
    }

    /**
     * 删除网元-DCN配置-DCN连接配置信息
     * 
     * @param id 网元-DCN配置-DCN连接配置主键
     * @return 结果
     */
    @Override
    public int deleteElementDcnConnectorById(String id)
    {
        return elementDcnConnectorMapper.deleteElementDcnConnectorById(id);
    }
}
